<div class="page company">
    <div class="action-bar">
        <div class="row">
            <div class="col-sm-12">
                <form>
                    <div class="row">
                        <div class="col-sm-3">
                            <ui-select ng-model="status.selected" theme="bootstrap">
                                <ui-select-match placeholder="确认类型">{{$select.selected.name}}</ui-select-match>
                                <ui-select-choices
                                        repeat="item in statuses | filter: $select.search">
                                    <div ng-bind-html="item.name | highlight: $select.search"></div>
                                </ui-select-choices>
                            </ui-select>
                        </div>

                        <div class="col-sm-3">
                            <input type="text" class="form-control" ng-model-options="options"
                                   is-open="startDateOpened"
                                   datepicker-popup="yyyy-MM-dd" show-button-bar="true"
                                   current-text="今天" clear-text="清空" close-text="关闭"
                                   placeholder="开始日期" ng-click="startDateOpened=true"
                                   ng-model="startTime">
                        </div>

                        <div class="col-sm-3">
                            <input type="text" class="form-control" ng-model-options="options"
                                   is-open="endDateOpened"
                                   datepicker-popup="yyyy-MM-dd" show-button-bar="true"
                                   current-text="今天" clear-text="清空" close-text="关闭"
                                   placeholder="结束日期" ng-click="endDateOpened=true"
                                   ng-model="endTime">
                        </div>
                        <div class="col-sm-1">
                            <button class="btn btn-primary" ng-click="searchOrder()">
                                查询
                            </button>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>

<div class="panel page-content">
    <div ng-if="orders.length<=0" class="nodata"></div>
    <table class="table table-hover" ng-if="orders.length>0">
        <thead>
        <tr>
            <th>用户</th>
            <th>下单时间</th>
            <th>总金额</th>
            <th>使用积分</th>
            <th>支付金额</th>
            <th>操作</th>
        </tr>
        </thead>
        <tbody>
        <tr ng-repeat="e in orders">
            <td>{{e.user.name == null?e.user.wxNickname:e.user.name}}</td>
            <td>{{e.orderTime | date:"yyyy-MM-dd HH:mm:ss"}}</td>
            <td>{{e.totalMoney | currency:'￥'}}</td>
            <td>{{e.useScore | number:0}}</td>
            <td>{{e.payMoney | currency:'￥'}}</td>
            <td>
                <button ng-show="!e.status" class="btn btn-warning btn-md mr10" ng-click="confirmOrder(e)">确认收款</button>
                <button ng-show="!e.status" class="btn btn-danger btn-md mr10" ng-click="removeOrder(e)">删除订单</button>
            </td>
        </tr>
        </tbody>
    </table>

    <div class="text-center">
        <pagination total-items="pager.totalItems" ng-model="pager.pageNo"
                    items-per-page="pager.pageSize" ng-change="searchOrder()"
                    previous-text="上一页" next-text="下一页" max-size="3"></pagination>
    </div>
</div>




